package com.scorpio.appuser.controller.rediostation;

import com.scorpio.appuser.domain.UserEntity;
import com.scorpio.common.core.controller.BaseController;
import com.scorpio.common.core.domain.Result;
import com.scorpio.scbasics.rediostation.service.IBizBannerService;
import com.scorpio.scbasics.rediostation.service.IBizCategoryService;
import com.scorpio.scbasics.rediostation.service.IBizSocialPartakeLinkService;
import com.scorpio.security.annotation.PersonalLogin;
import com.scorpio.security.annotation.PersonalLoginUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @BelongsPackage: com.scorpio.appuser.controller.rediostation
 * @Author: zzh
 * @CreateTime: 2020-10-15 19:50
 * @Description:
 */

@RestController
@RequestMapping("/api/radiostation")
public class RadiostationController extends BaseController {

    @Autowired
    private IBizBannerService iBizBannerService;
    @Autowired
    private IBizCategoryService iBizCategoryService;
    @Autowired
    private IBizSocialPartakeLinkService iBizSocialPartakeLinkService;


    @PersonalLogin
    @PostMapping("banner")
    public Result queryBanner(@PersonalLoginUser UserEntity entity) {
        return iBizBannerService.queryBanner();
    }


    @PersonalLogin
    @PostMapping("category")
    public Result queryCategory(@PersonalLoginUser UserEntity entity) {
        return iBizCategoryService.queryCategory();
    }

    @PersonalLogin
    @PostMapping("add_partake")
    public Result addPartake(@PersonalLoginUser UserEntity entity,
                             String user_id,
                             String to_user_id,
                             String social_id) {
        return iBizSocialPartakeLinkService.addPartake(user_id, to_user_id, social_id);
    }

}
